<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>网络安全摘要信息</title>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <style>
        :root {
            --primary-color: #1e3a5f;
            --secondary-color: #3b82f6;
            --success-color: #10b981;
            --warning-color: #f59e0b;
            --danger-color: #ef4444;
            --gray-color: #6b7280;
            --background-color: #f9fafb;
            --card-padding: 1.5rem;
            --border-radius-lg: 0.5rem;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: 'Segoe UI', sans-serif;
            background-color: var(--background-color);
            color: #111827;
            line-height: 1.6;
            padding: 2rem;
        }

        header {
            text-align: center;
            padding-bottom: 2rem;
            border-bottom: 1px solid #e5e7eb;
            margin-bottom: 2rem;
        }

        .title {
            font-size: 1.8rem;
            font-weight: 700;
            color: #111827;
            margin-bottom: 0.5rem;
        }

        .title.h1 {
            font-size: 2.5rem;
            margin-bottom: 1rem;
        }

        .section {
            margin-bottom: 3rem;
            background: white;
            padding: 1.5rem;
            border-radius: var(--border-radius-lg);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        }

        .flex-container {
            display: flex;
            flex-wrap: wrap;
            gap: 1.5rem;
        }

        .card {
            background: white;
            padding: var(--card-padding);
            border-radius: var(--border-radius-lg);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s ease;
        }

        .card:hover {
            transform: translateY(-2px);
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 1rem;
        }

        table,
        th,
        td {
            border: 1px solid #e5e7eb;
        }

        th,
        td {
            padding: 0.75rem;
            text-align: left;
        }

        th {
            background-color: #f3f4f6;
            font-weight: 600;
        }

        .pie-chart {
            max-width: 300px;
            margin-left: auto;
            margin-right: auto;
        }

        .tooltip-box {
            font-size: 0.85rem;
            padding: 0.5rem;
            border: 1px solid #d1d5db;
            background-color: #f9fafb;
            max-width: 500px;
            margin-top: 1rem;
        }

        @media (max-width: 768px) {
            .section {
                padding: 1rem;
            }

            .pie-chart {
                max-width: 200px;
            }

            .title.h1 {
                font-size: 2rem;
            }

            table {
                font-size: 0.85rem;
            }
        }
    </style>
</head>

<body>
    <header>
        <div class="title h1">网络安全摘要信息</div>
        <div class="desc">资产网络攻击相关数据分析报告</div>
    </header>

    <main>
        <!-- 资产分布部分 -->
        <section class="section">
            <div class="title">资产分布情况</div>
            <div class="flex-container">
                <div class="card">
                    <h3 class="title">操作系统分布</h3>
                    <ul>
                        <li>CentOS 7.9 (1台)</li>
                        <li>Kylin Linux V10 (4台)</li>
                    </ul>
                </div>
                <canvas class="pie-chart" id="osPieChart"></canvas>
            </div>
        </section>

        <!-- 入侵攻击类型 -->
        <section class="section">
            <div class="title">入侵攻击类型列表</div>
            <div class="flex-container">
                <div class="card w-80" style="width: 80%">
                    <div class="attack-type" data-tooltip="攻击用于检测隐藏的恶意文件">
                        <strong>隐藏文件目录检测</strong>
                    </div>
                    <div class="attack-type" data-tooltip="检测敏感命令执行行为">
                        <strong>敏感命令执行检测</strong>
                    </div>
                    <!-- 其他攻击类型类似结构 -->
                </div>
                <canvas class="pie-chart" id="attackTypeChart"></canvas>
            </div>
        </section>

        <!-- 入侵攻击阶段 -->
        <section class="section">
            <div class="title">入侵攻击阶段</div>
            <div class="flex-container">
                <div class="card w-60" style="width: 60%">
                    <h3 class="title">入侵情况统计</h3>
                    <p class="tooltip-box" data-tooltip="其中Kylin 92c852">3台Kylin系统确认遭受入侵</p>
                    <p>1台Kylin系统（227b21）和1台CentOS系统（92c852）未检测到入侵活动</p>
                </div>
                <canvas class="pie-chart" id="infectionStageChart"></canvas>
            </div>
        </section>

        <!-- 资产风险 -->
        <section class="section">
            <div class="title">资产风险相关情况</div>
            <div class="flex-container">
                <table>
                    <thead>
                        <tr>
                            <th>风险等级</th>
                            <th>数量</th>
                            <th>占比</th>
                            <th>主要漏洞</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>高危</td>
                            <td>5</td>
                            <td>23.8%</td>
                            <td>CVE-2020-26968, CVE-2023-31486</td>
                        </tr>
                        <!-- 其他行 -->
                    </tbody>
                </table>
                <canvas class="pie-chart" id="riskLevelChart"></canvas>
            </div>
        </section>

        <!-- 关键漏洞 -->
        <section class="section">
            <div class="title">关键漏洞分析</div>
            <div class="flex-container">
                <div class="card w-70" style="width: 70%">
                    <div class="vulnerability" data-tooltip="攻击者可完全控制系统">
                        <strong>CVE-2020-26968（高危）</strong>
                    </div>
                    <div class="vulnerability" data-tooltip="攻击者可获取root权限">
                        <strong>CVE-2023-31486（高危）</strong>
                    </div>
                    <!-- 其他漏洞 -->
                </div>
                <canvas class="pie-chart" id="vulnerabilityChart"></canvas>
            </div>
        </section>

        <!-- 攻击事件统计 -->
        <section class="section">
            <div class="title">入侵事件攻击统计</div>
            <div class="flex-container">
                <table>
                    <thead>
                        <tr>
                            <th>攻击类型</th>
                            <th>次数</th>
                            <th>影响资产</th>
                            <th>威胁等级</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>SSH软链接后门</td>
                            <td>80</td>
                            <td>3台Kylin</td>
                            <td class="text-danger">高危</td>
                        </tr>
                        <!-- 其他行 -->
                    </tbody>
                </table>
                <canvas class="pie-chart" id="attackStatsChart"></canvas>
            </div>
        </section>

        <!-- 攻击溯源 -->
        <section class="section">
            <div class="title">攻击溯源分析</div>
            <div class="card">
                <div class="timeline" style="position: relative; padding-left: 1.5rem;">
                    <div class="timeline-item">
                        <div class="timeline-dot"
                            style="position: absolute; left: 0; width: 12px; height: 12px; background: red; border-radius: 50%; transform: translateX(-50%);">
                        </div>
                        <div style="margin-bottom: 1rem;">攻击者具有Linux系统专业知识</div>
                    </div>
                    <!-- 其他时间线节点 -->
                </div>
            </div>
        </section>
    </main>

    <script>
        // 资产分布饼图
        new Chart(document.getElementById('osPieChart'), {
            type: 'pie',
            data: {
                labels: ['CentOS', 'Kylin'],
                datasets: [{
                    label: '资产数量',
                    data: [1, 4],
                    backgroundColor: ['#3b82f6', '#10b981']
                }]
            },
            options: {
                responsive: true,
                plugins: {
                    legend: {
                        position: 'right'
                    }
                }
            }
        });

        // 攻击类型饼图
        new Chart(document.getElementById('attackTypeChart'), {
            type: 'pie',
            data: {
                labels: ['隐藏文件', '敏感命令', '系统信息检测', 'tmp监控', '受限Shell', '可疑命令', '二进制填充', '系统日志'],
                datasets: [{
                    data: [10, 8, 6, 5, 4, 3, 2, 1],
                    backgroundColor: ['#3b82f6', '#f59e0b', '#10b981', '#ef4444', '#8b5cf6', '#ec4899', '#6366f1', '#14b8a6']
                }]
            }
        });

        // 入侵阶段饼图
        new Chart(document.getElementById('infectionStageChart'), {
            type: 'pie',
            data: {
                labels: ['受感染', '未感染'],
                datasets: [{
                    data: [3, 2],
                    backgroundColor: ['#ef4444', '#10b981']
                }]
            }
        });

        // 风险等级饼图
        new Chart(document.getElementById('riskLevelChart'), {
            type: 'pie',
            data: {
                labels: ['高危', '中危', '低危'],
                datasets: [{
                    data: [5, 15, 1],
                    backgroundColor: ['#ef4444', '#f59e0b', '#10b981']
                }]
            }
        });

        // 漏洞分布饼图
        new Chart(document.getElementById('vulnerabilityChart'), {
            type: 'pie',
            data: {
                labels: ['CVE-2020-26968', 'CVE-2023-31486', 'CVE-2022-34903'],
                datasets: [{
                    data: [1, 4, 5],
                    backgroundColor: ['#ef4444', '#f59e0b', '#14b8a6']
                }]
            }
        });

        // 攻击事件饼图
        new Chart(document.getElementById('attackStatsChart'), {
            type: 'pie',
            data: {
                labels: ['SSH后门', '历史记录删除', '系统配置', '持久化', '可疑命令'],
                datasets: [{
                    data: [80, 72, 3928, 102, 27],
                    backgroundColor: ['#ef4444', '#ef4444', '#f59e0b', '#f59e0b', '#10b981']
                }]
            }
        });

        // 工具提示初始化
        document.querySelectorAll('[data-tooltip]').forEach(el => {
            el.addEventListener('mouseenter', function (e) {
                const tooltip = document.createElement('div');
                tooltip.className = 'tooltip';
                tooltip.style.position = 'absolute';
                tooltip.style.backgroundColor = '#333';
                tooltip.style.color = '#fff';
                tooltip.style.padding = '0.4em';
                tooltip.style.borderRadius = '4px';
                tooltip.style.maxWidth = '300px';
                tooltip.style.zIndex = '1000';
                tooltip.textContent = e.currentTarget.getAttribute('data-tooltip');
                document.body.appendChild(tooltip);

                const coords = e.currentTarget.getBoundingClientRect();
                tooltip.style.left = (coords.left + window.scrollX) + 'px';
                tooltip.style.top = (coords.top + window.scrollY - 20) + 'px';

                e.currentTarget.dataset.tooltipInstance = tooltip;
            });

            el.addEventListener('mouseleave', function (e) {
                if (e.currentTarget.dataset.tooltipInstance) {
                    e.currentTarget.dataset.tooltipInstance.remove();
                }
            });
        });
    </script>
</body>

</html>